<%@page pageEncoding="utf-8" contentType="text/html; charset=utf-8" %>
<%@ include file="/admin/include/init_admin.jsp" %>
<%@ page import="com.joinhawaii.admin.product.*" %>
<%

	HashList code114	= CommonUtil.getCodeList("114");	//호텔구분
	HashList code005	= CommonUtil.getCodeList("005");	//항공사


	String s_air_code		= StringUtil.nvl(request.getParameter("s_air_code"));
	String s_block_yn		= StringUtil.nvl(request.getParameter("s_block_yn"));
	String s_start_date		= StringUtil.toHan(request.getParameter("s_start_date"));
	String s_curr_page		= StringUtil.nvl(request.getParameter("s_curr_page"),"1");


	HashMap infos = new HashMap();
	infos.put("air_code",	s_air_code);
	infos.put("block_yn",	s_block_yn);
	infos.put("start_date",	s_start_date);
	infos.put("curr_page", 	s_curr_page);

	ProductDAO dao 	= new ProductDAO();
	HashList list 	= dao.selectAirList(infos);



%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
	<title>조인하와이</title>
	<%@ include file="/admin/include/cssnjs.jsp"  %>
	<script type="text/javascript">
	$(document).ready(function() {

		$('#list').find('tr').hover(
				function () { $(this).addClass("hover"); }
			  , function () { $(this).removeClass("hover"); }
			)
			.click(function(){
				$('#air_id').val($(this).attr('air_id'));
				$('#searchForm').attr('action', './airDetail.jsp');
				$('#searchForm').submit();
			});


		$('#s_start_date').mask('9999.99.99').datepicker();
	});


	function fnNew() {
		$('#air_id').val('XXXXXX');
		$('#searchForm').attr('action', './airDetail.jsp?job_type=C');
		$('#searchForm').submit();
	}

	</script>
</head>
<body>
<div id="wrap">
	<div id="top">
		<%@ include file="/admin/include/top.jsp" %>
	</div>
	<div id="page">
		<div id="menu">
			<%@ include file="/admin/include/leftMenu.jsp" %>
		</div>
		<div id="contents">
			<div class="menu_title">
				<h1>할인항공</h1>
				<p>관리자 > 상품관리 > <b>할인항공</b></p>
			</div>
			<div class="clear line_01"></div>

			<form id="searchForm" method="post" action="./airList.jsp">
			<input type="hidden" name="air_id" id="air_id" value=""/>
			<table cellpadding="0" cellspacing="0" class="table_01 mt15">
			<colgroup>
				<col width="100px" />
				<col width="160px" />
				<col width="100px" />
				<col width="160px" />
				<col width="100px" />
				<col  />
			</colgroup>
			<tr>
			    <th><p>항공사</p></th>
			    <td>
			    	<select name="s_air_code">
			    	<option value="">전체</option>
					<%= StringUtil.makeOption(code005, s_air_code) %>
				  	</select>
				</td>
			    <th><p>블럭항공</p></th>
			    <td>
			    	<select name="s_block_yn">
          	  	  	<option value="">전체</option>
					<%= StringUtil.makeOption(code114, s_block_yn) %>
				  	</select>
				</td>
				<th><p>출발일</p></th>
				<td class="brx">
					<input type="text" name="s_start_date" id="s_start_date" value="<%= s_start_date %>" class="w90 c"/>
				</td>
			</tr>
			</table>

			<div class="mt10 mb10 r">
				<input type="image" src="/images/admin/btn_search.gif" class="button">
				<a href="#nohref" onclick="fnNew()"><img src="/images/admin/btn_new.gif"></a>
			</div>

			</form>

			<div class="search_result">검색결과 : <%= infos.get("total_count") %>건</div>

		    <table cellpadding="0" cellspacing="0" class="table_03">
				<colgroup>
					<col width="40px"/>
					<col width="100px"/>
					<col width="100px"/>
					<col width="100px"/>
					<col width="100px"/>
					<col width="100px"/>
					<col width="100px"/>
					<col width="100px"/>
					<col width="100px"/>
					<col />
				</colgroup>
				<thead>
					<tr>
						<th><p>No</p></th>
						<th><p>항공사</p></th>
						<th><p>발권사</p></th>
						<th><p>블럭여부</p></th>
						<th><p>출발일</p></th>
						<th><p>도착일</p></th>
						<th><p>기간</p></th>
						<th><p>가능좌석</p></th>
						<th class="r"><p>할인항공료</p></th>
						<th><p>경유/직항</p></th>
					</tr>
				</thead>
				<tbody id="list">
			<%	for (int i = 0; i < list.size(); i++) { %>
					<tr air_id="<%= list.get("air_id",i) %>">
						<td>
							<%= StringUtil.parseInt(infos.get("total_count")) - StringUtil.parseInt(infos.get("start_num")) - i %>
						</td>
						<td><%= list.get("air_name", i) %></td>
						<td><%= list.get("company_name", i) %></td>
						<td><%= list.get("block_yn", i) %></td>
						<td><%= StringUtil.toDate(list.get("from_date", i)) %></td>
						<td><%= StringUtil.toDate(list.get("to_date", i)) %></td>
						<td><%= list.get("start_day", i) %></td>
						<td><%= list.get("seat_count", i) %></td>
						<td class="r"><%= StringUtil.toPrice(list.get("sales_price", i)) %></td>
						<td><%= list.get("air_type_name", i) %></td>
					</tr>
			<%	} %>
				</tbody>
			</table>

			<div class="paging">
				<%= StringUtil.getPageHtml(infos, "./airList.jsp") %>
			</div>
		</div>
	</div>
</div>
</body>
</html>
